package com.tsj.model.controller;

import com.tsj.model.utils.AesEncrypt;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author taoshujian
 * @version 1.0
 * @since 2025-11-25 13:56:58
 */
@RestController
@Tag(name = "加解密模块")
@RequestMapping("/encryption")
public class EncryptionController {


    @Operation(summary = "AES加密")
    @PostMapping("/aes/encrypt")
    public String aesEncrypt(String key, String content){
        return AesEncrypt.encrypt(key, content);
    }

    @Operation(summary = "AES解密")
    @PostMapping("/aes/decrypt")
    public String aesDecrypt(String key, String content){
        return AesEncrypt.decrypt(key, content);
    }
}
